package com.oauth.global.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.HasWidgetInfo;

public class ApplicationPanel extends Composite {

	private static ApplicationPanelUiBinder uiBinder = GWT.create(ApplicationPanelUiBinder.class);

	interface ApplicationPanelUiBinder extends UiBinder<Widget, ApplicationPanel> {
	}

	@UiField
	Button addButton;

	@UiField
	SimplePanel imagePanel;

	Image appImage;

	public ApplicationPanel(HasWidgetInfo hasWidgetInfo) {
		initWidget(uiBinder.createAndBindUi(this));
		appImage = hasWidgetInfo.getWidgetImage();
		appImage.setSize("200px", "100px");
		imagePanel.add(appImage);
		addButton.addClickHandler(new SignInButtonClickHandler(hasWidgetInfo.getId()));
	}

}
